# pragma once
# include <map>
# include <functional>

namespace ZDSJ
{
    enum Deal_State{
        Nothing,
        TagBegin,
        Description,
        GetTagName,
        SkipSpace,
        GetKey,
        GetValue,
        TagEnd,
        Transfer,
        CloseTag
    };

    class State{
    public:
        using callbackType = Deal_State(Deal_State);
        State();
        State(Deal_State _state);
        void setCallBack(Deal_State _state, std::function<callbackType> _callback);
        Deal_State operator()();
        void operator=(Deal_State _state);
        ~State();
    private:
        Deal_State m_state;
        Deal_State m_last_state;
        std::map<Deal_State, std::function<callbackType>> m_callback;
    };
} // namespace ZDSJ
